import request from '@/utils/request'

// 获取所有权限点
export function getPermissionListApi() {
  return request({
    url: '/sys/permission'
  })
}

/**
 *  添加权限点
 * @param {*} data
 * @returns
 */
export function addPermissionApi(data) {
  return request({
    method: 'POST',
    url: '/sys/permission',
    data
  })
}

/**
 *根据ID更新权限点详情
 * @param {*} data
 * @returns
 */
export function updatePermissionApi(data) {
  return request({
    method: 'PUT',
    url: `/sys/permission/${data.id}`,
    data
  })
}

/**
 *  根据id删除权限点
 * @param {*} id
 * @returns
 */
export function delPermissionApi(id) {
  return request({
    method: 'DELETE',
    url: `/sys/permission/${id}`
  })
}

/**
 * 根据ID获取权限点详情
 * @param {*} id
 * @returns
 */
export function getPermissionDetailApi(id) {
  return request({
    url: `/sys/permission/${id}`
  })
}
